#include <stdio.h>
#include <string.h>
#include <algorithm>

int n1, n2;
int i, j;
int v1[20], v2[20];
double vv[200];
double ans;

bool init()
{
//    if (scanf("%d%d", &n1, &n2)==EOF) return false;
    scanf("%d", &n1);
    if (n1==0) return false;
    scanf("%d", &n2);
    for (i=0; i<n1; ++i)
        scanf("%d", v1+i);
    for (i=0; i<n2; ++i)
        scanf("%d", v2+i);
    return true;
}   
void deal()
{
    double dis;
    int k=0;
    for (i=0; i<n1; ++i)
        for (j=0; j<n2; ++j)
           vv[k++] = (double)v1[i]/v2[i];     
    std::sort(vv, vv+k);
    ans = 0;
    for (i=1; i<k; ++i)
    {
         dis = vv[i]-vv[i-1];
         if (dis>ans) ans = dis;
    }    
    printf("%lf\n", ans);
            
}     

int main()
{
    while (init())
    {
        deal();
    }        
    
    return 0;
}    

